import { TaskPressType, TaskPressTypeList } from '@/pages/Task/utils';
import { getDisplayText } from '@/utils/dataDictUtil';
import InfoModal from '@/pages/Task/components/InfoModal';
import { fetchOperateDetails } from './util';
import { REASON_RENDER } from './renderUtil';
// 催办详情
const cols = [
    {
        title: '温馨提示',
        dataIndex: 'processTaskEmployeeName',
        render: value => {
            if (!value) {
                return '';
            }
            return `当前任务正在待【${value} 】处理中`;
        }
    },
    {
        title: '被催办人',
        dataIndex: 'processTaskEmployeeName'
    },
    {
        title: '催办内容',
        dataIndex: 'urgeType',
        render: value => getDisplayText(TaskPressTypeList, value)
    },
    {
        dataIndex: 'content',
        render: REASON_RENDER
    }
];
export const showPressInfoModal = async (id, operateRecordId) => {
    const dataSource = await fetchOperateDetails(id, operateRecordId);
    let columns = [...cols];
    if (dataSource.urgeType === TaskPressType.SYSTEM) {
        columns = columns.slice(0, 3);
    }
    return InfoModal.showCommonModal({ columns, dataSource, title: '催办详情', width: 480 });
};
